<?php use frontend\models\Order; ?>
<?php use common\helpers\Date; ?>
<?php foreach ($data as $order): ?>
<li class="clear_fl" data-price="<?= $order->price ?>" data-name="<?= $order->product->table_name ?>" data-total-time="<?= $order->stop_profit_point * 60 ?>" data-time="<?= Date::timeDiff($order->sell_time) ?>" data-state="<?= $order->order_state ?>">
    <div class="lf clear_fl">
        <p class="p_value"><?= $order->product->name ?></p>
        <?php $riseClass = $order->rise_fall == Order::RISE ? 'up_label_btn' : 'down_label_btn'; ?>
        <?php $riseText = $order->rise_fall == Order::RISE ? '涨' : '跌'; ?>
        <p class="p_value"><span class="<?= $riseClass ?>"><?= $riseText ?></span></p>
        <p class="p_key">剩余时间</p>
        <?php $profitRate = sprintf('%.2f', 100 - $order->one_profit * 100 / $order->deposit) ?>
        <p class="p_value red persent"><?= $profitRate ?>%</p>
        <div class="down_count clear_fl">
            <p class="lf time_count"><?= Date::timeDiff($order->sell_time) ?>s</p>
            <p class="down_count_press">
                <span></span>
            </p>
        </div>
    </div>
    <div class="rt clear_fl profitLoss" data-oprofit="<?= $order->one_profit ?>" data-fee="<?= $order->fee ?>" data-deposit="<?= $order->deposit ?>">
        <p class="p_key">投资金额</p>
        <p class="p_value"><?= floatval($order->deposit) ?></p>
        <p class="p_key">建仓价</p>
        <p class="p_value"><?= floatval($order->price) ?></p>
        <p class="p_key">当前价</p>
        <p class="p_value curPrice"><?= floatval($order->product->dataAll->price) ?></p>
        <p class="p_key">盈亏</p>
        <p class="p_value red profit_con"><?= floatval($order->profit) ?></p>
    </div>
</li>
<?php endforeach ?>